x11-hash-js
Performs the x11 hashing algorithm used in the Dash cryptocurrency in JavaScript.
Usage
Install the library as a Node module.
$ npm install --save x11-hash-js
Reference the library within a Node module.
var x11 = require('x11-hash-js');
console.log(x11.digest('The great experiment continues.'));
Download the browserified library from the dist folder and include it in your HTML.
<html>
<head>
<script src='./dist/x11-hash.min.js'></script>
<script>
let x11 = require('x11hash');
console.log(x11.digest('The great experiment continues.'));
</script>
</head>
<body></body>
</html>
Call individual hash functions within the x11 digest.
console.log(x11.blake('The great experiment continues.'));
console.log(x11.bmw('The great experiment continues.'));
console.log(x11.cubehash('The great experiment continues.'));
console.log(x11.echo('The great experiment continues.'));
console.log(x11.groestl('The great experiment continues.'));
console.log(x11.jh('The great experiment continues.'));
console.log(x11.keccak('The great experiment continues.'));
console.log(x11.luffa('The great experiment continues.'));
console.log(x11.shavite('The great experiment continues.'));
console.log(x11.simd('The great experiment continues.'));
console.log(x11.skein('The great experiment continues.'));
API
x11.digest(str)
Returns a string
representation of the x11 hash of an input string
str.
str
Type: string
The string to be hashed.
x11.digest(input, inputFormat, outputFormat)
Returns the x11 hash of input with the input and output types variable between a string
, 8 bit array
or 32 bit array
input
Type: string
or array
The input data to be hashed.
inputFormat
Type: number
Specifies the format and type of the input value:
- 0:
string
- 1: 8 bit
array
- 2: 32 bit
array
outputFormat
Type: number
Specifies the format and type of the return value:
- 0:
string
- 1: 8 bit
array
- 2: 32 bit
array